﻿using Domain.Entities;
using FluentMigrator;
using FrameworkCore.Extensions;

namespace AiBLSmartEdu.Module.SmartDictionaries.API.Migrations;

[Migration(202409231140)]
public class ChineseDictionaryAddColumn : ForwardOnlyMigration
{
    public override void Up()
    {
        Alter.Table(MigrationExpressions.GetTableName(typeof(ChineseDictionary)))
          .AddColumn(MigrationExpressions.ColumnNameFor<ChineseDictionary>(nameof(ChineseDictionary.Word))).AsString(int.MaxValue).Nullable().WithColumnDescription("汉字")
          .AddColumn(MigrationExpressions.ColumnNameFor<ChineseDictionary>(nameof(ChineseDictionary.Description))).AsString(int.MaxValue).Nullable().WithColumnDescription("汉字描述")
          .AddColumn(MigrationExpressions.ColumnNameFor<ChineseDictionary>(nameof(ChineseDictionary.IsFavorited))).AsBoolean().Nullable().WithDefaultValue(true).WithColumnDescription("是否收藏");
    }
}